cd ../..

global release = "release/paper_sumstats"
global sumstats_data_path = "build/paper_sumstats/data"
global indiv_data_path = "../../analysis/estimationcode/specs/lowrisk_simplemh_censor0.2_main/output"
global switchers_data_path = "build/paper_sumstats/data"
global mlr_data_path = "../../data/orig"
global base_data_path = "../../data"

* set scheme ndm_scheme, perm

shell mkdir -p "$sumstats_data_path"
shell mkdir -p "$release/plots"
shell mkdir -p "$release/tables"

log using "$release/log.txt", replace

* Load functions
qui do ./source/paper_sumstats/plot_mainf_costs.do
qui do ./source/paper_sumstats/plot_mainf_markups.do
qui do ./source/paper_sumstats/plot_mainf_prem.do

qui do ./source/paper_sumstats/tab_admincosts.do
qui do ./source/paper_sumstats/tab_sum_stats.do
qui do ./source/paper_sumstats/tab_switchers_matched.do
qui do ./source/paper_sumstats/tab_uninsured_demographics.do

qui do ./source/paper_sumstats/helpers_import.do
qui do ./source/paper_sumstats/helpers.do

* Call functions
import_all_subs_csv
harmonize_subs_data
harmonize_switchers_data
get_serff_data

plot_mainf_costs
plot_mainf_markups
plot_mainf_prem

tab_sum_stats_demographics
tab_sum_stats_insurer_spending
tab_sum_stats_count
tab_sum_stats_count_insurance

tab_switchers_demographics
tab_uninsured_demographics

tab_admincosts
tab_admincosts_counts